import { http } from "../utils/request"
export interface taskparams{
  id:string
}
interface url{
  url:string
}
export  interface exceptionItem{
  exceptionTime:string

  exceptionPlace:string

  exceptionType:string

  exceptionDescribe:string
  handleResult:string
  exceptionImagesList:url[]
}
export interface  detailitem{
  actualArrivalTime:string,
  actualDepartureTime: string

  cargoPickUpPictureList:url[]

  cargoPictureList:url[]
  deliverPictureList:url[]
  driverId:string

  driverName:string

  endAddress:string

  endAgencyId:string
  endCity:string
  endProvince:string

  finishHandoverName:string

  finishHandoverPhone:string

  id:string

  licensePlate:string

  planArrivalTime:string

  planDepartureTime:string

  startAddress:string

  startAgencyId:string

  startCity:string

  startHandoverName:string

  startHandoverPhone:string

  startProvince:string

  status:number

  certificatePictureList:url[]

  exceptionList:exceptionItem[]
  transportTaskId:string
}
export interface detailData{
code:string,
  data:detailitem,
  msg:string
}
export interface taskorderitems{
  count: number,
  createTime: string,
  id: string,
  totalWeight: number
}
export interface  taskordertem{
  counts:number
  page: number
  items:taskorderitems[]
  pageSize: number,
  pages: number
}
export interface  taskorderData{
  code:string,
  data:taskordertem,
  msg:string
}
export interface taskorderparams{
  page:1,
  limit:10,
  taskId:string
}

export const taskdetail = (data:taskparams): Promise<detailData> => {
  return http.get<detailData>(`/tasks/details/${data.id}`)
}
export const taskorders = (data:taskorderparams): Promise<taskorderData> => {
  return http.get<taskorderData>(`/tasks/orders`,data)
}
